home *** CD-ROM | disk | FTP | other *** search
/ Aminet 25 / Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso / Aminet / util / sys / 2b_mv_prefs.lha / MultiViewPrefs / Install < prev   
Encoding:
Text File  |  1998-03-27  |  7.7 KB  |  303 lines

  1. ;
  2. ; $VER: Install MultiView Preferences 3.2 (26.03.98)
  3. ;
  4. ; Installer script for MultiView Preferences.
  5. ;
  6.  
  7. (set #english-lang    1)
  8. (set #polish-lang     2)
  9.  
  10. ; Get current language (no need for lots of silly icons! ;). However, this
  11. ; won't properly work for all versions of the Installer. Some don't
  12. ; understand the language "default" in the tool types... :/
  13.  
  14. (if (= (exists "Env:Language") 1)
  15.   ; GetEnv reports "String too long" if the variable doesn't exist! :/
  16.   ; Dunno if this is fixed in V43... But we need to check anyway.
  17.   (set @language (getenv "language"))
  18. )
  19.  
  20.  
  21. ;**************************************************************************
  22. ;
  23. ; English strings
  24. ;
  25.  
  26. (set #default-lang #english-lang)
  27. (set #builtin-lang "(built in)")
  28. (set #bad-kick "You must have AmigaOS Release 2.04 or higher to use MultiView.")
  29. (set #install-parts "Please select the parts you wish to install")
  30. (set #item-program  "MultiView")
  31. (set #item-guide    "MultiViewPrefs.guide")
  32.  
  33. (set #parts-header-help
  34.   (cat
  35.     "    Here you select the different parts of MultiView that you would like to "
  36.     "install. After that, you select the details of the installation (such as "
  37.     "where the different files should be installed). You may choose to install "
  38.     "the following items:\n"
  39.   )
  40. )
  41.  
  42. (set #item-program-help
  43.   (cat
  44.     "    MultiView: This program is a configuration program for my MultiView"
  45.     "and should be installed in SYS:Prefs/ directory.\n"
  46.   )
  47. )
  48.  
  49. (set #item-guide-help
  50.   (cat
  51.     "    MultiViewPrefs.guide: The manual, in AmigaGuide® format. It contains "
  52.     "some general information about MultiView Preferences.\n"
  53.   )
  54. )
  55.  
  56. (set #parts-footer-help
  57.   (cat
  58.     "    For more information about these items, please see the manual.\n"
  59.   )
  60. )
  61.  
  62. ; Only for expert users
  63. (set #where-program "Where would you like to install Main program?")
  64. (set #where-program-help
  65.   (cat
  66.     "    MultiView: This program is a configuration program for my MultiView"
  67.     "and should be installed in SYS:Prefs/ directory.\n"
  68.   )
  69. )
  70.  
  71. (set #where-guide "Where would you like to install MultiViewPrefs.guide?")
  72.  
  73. (set #where-guide-help
  74.   (cat
  75.     "    MultiViewPrefs.guide is a file in the standard AmigaGuide® format. "
  76.     "As MultiView currently makes specific use of this file, you can install "
  77.     "it whereever you find convenient. If you have OS 3.0 or higher, "
  78.     "one such place is \"Help:\", as this is where other AmigaGuide® "
  79.     "files often are installed.\n"
  80.   )
  81. )
  82.  
  83. ; Only for expert users, and an icon wasn't found
  84. (set #copy-guide-icon "Do you want to install the icon for MultiViewPrefs.guide?")
  85.  
  86. (set #copy-guide-icon-help
  87.   (cat
  88.     "    Since you stated that you are an expert user, and there currently "
  89.     "is no icon for MultiViewPrefs.guide where you selected to install it, "
  90.     "you get a chance to decide if the icon should be installed as well.\n"
  91.   )
  92. )
  93.  
  94. (set #copy "Copying %s to %s...")
  95.  
  96. ;**************************************************************************
  97. ;
  98. ; Polish strings
  99. ;
  100.  
  101. (if (= @language "polski")
  102.   (
  103.     (set #default-lang #polski-lang)
  104.     (set #builtin-lang "(wbudowany)")
  105.     (set #bad-kick "Musisz mieê system w wersji przynajmniej 2.04.")
  106.     (set #install-parts "Wybierz czëôci, które chcesz zainstalowaê")
  107.     (set #item-program "MultiView")
  108.     (set #item-guide "MultiViewPrefs.guide")
  109.  
  110.     (set #parts-header-help
  111.       (cat
  112.         "    Tu moûesz wybraê poszczególne czëôci pakietu do zainstalowania. Potem "
  113.         "wybierzesz gdzie chcesz je zainstalowaê. Do wyboru masz :\n"
  114.       )
  115.     )
  116.  
  117.     (set #item-program-help
  118.       (cat
  119.         "    MultiView: To jest program konfiguracyjny dla mojego MultiView-a "
  120.         "Powinieneô zainstalowaê go w katalogu SYS:Prefs/.\n"
  121.       )
  122.     )
  123.  
  124.     (set #item-guide-help
  125.       (cat
  126.         "    MultiViewPrefs.guide: Dokumentacja w formacie AmigaGuide®.\n"
  127.       )
  128.     )
  129.  
  130.     (set #parts-footer-help
  131.       (cat
  132.         "    Dodatkowe informacje znajdziesz w dokumentacji.\n\n"
  133.       )
  134.     )
  135.  
  136.     ; Only for expert users
  137.     (set #where-program "Gdzie chcesz zainstalowaê gîówny program?")
  138.     (set #where-program-help
  139.       (cat
  140.         "    MultiView: To jest program konfiguracyjny dla mojego MultiView-a "
  141.         "Powinieneô zainstalowaê go w katalogu SYS:Prefs/.\n"
  142.       )
  143.     )
  144.  
  145.     (set #where-guide "Gdzie chcesz zainstalowaê MultiViewPrefs.guide?")
  146.     (set #where-guide-help
  147.       (cat
  148.         "    MultiViewPrefs.guide jest plikiem w standardzie AmigaGuide®. "
  149.         "Proponowanym miejscem jest HELP:\n"
  150.       )
  151.     )
  152.  
  153.     (set #copy-guide-icon "Czy chcesz zainstalowaê ikonë dla MultiViewPrefs.guide?")
  154.     (set #copy "Kopiujë %s do %s...")
  155.   )
  156. )
  157.  
  158. ;**************************************************************************
  159. ;
  160. ; The actual installation script
  161. ;
  162. ; First some initializations
  163. ;
  164.  
  165. ; Check Kickstart version. Exit if not at least 2.04
  166. (if (< (/ (getversion) 65536) 37)
  167.         (abort #bad-kick)
  168. )
  169.  
  170. ; Since files are scatter installed, don't mention any specific location.
  171. (set @default-dest "")
  172.  
  173. ; Request proportinal fonts, if supported. This string is
  174. ; prepended to the first askoptions choice.
  175. (if (>= @installer-version 2752518)     ; 42 * 65536 + 6
  176.   ; At least version 42.6
  177.   (set #propfont "p")
  178.   ; Pre V42
  179.   (set #propfont "")
  180. )
  181.  
  182. (set #item-num-prog      1)
  183. (set #item-num-guide     2)
  184.  
  185. ; Find out default values for parts to install
  186. (set #install-default (BITOR #item-num-prog #item-num-guide))
  187.  
  188. ; Everything ready
  189.  
  190. (welcome)
  191.  
  192. ; Ask the user what to install
  193. (set #install-files
  194.   (askoptions
  195.     (prompt #install-parts)
  196.     (help #parts-header-help
  197.       #item-program-help
  198.       #item-guide-help
  199.       #parts-footer-help "\n"
  200.       @askoptions-help)
  201.     (choices
  202.       (cat #propfont #item-program)
  203.       #item-guide
  204.     )
  205.     (default #install-default)
  206.   )
  207. )
  208.  
  209. ; Ask the user for the location of all parts
  210.  
  211. (set #program-dest  "SYS:Prefs")
  212.  
  213. ; Location for MultiView program (for experts)
  214. (if (AND (= @user-level 2) (BITAND #install-files #item-num-prog))
  215.   (set #program-dest
  216.     (askdir
  217.       (prompt  #where-program)
  218.       (help    #where-program-help "\n" @askdir-help)
  219.       (default #program-dest)
  220.     )
  221.   )
  222. )
  223.  
  224. ; Location for MultiViewPrefs.guide
  225. (if (BITAND #install-files #item-num-guide)
  226.   (
  227.     (set #guide-dest "Work:")
  228.  
  229.     (if (exists "Help:")
  230.       (set #guide-dest "Help:")
  231.     )
  232.  
  233.     (set #guide-dest
  234.       (askdir
  235.         (prompt  #where-guide)
  236.         (help    #where-guide-help "\n" @askdir-help)
  237.         (default #guide-dest)
  238.       )
  239.     )
  240.  
  241.     (set #dest-guide-name (tackon #guide-dest "MultiViewPrefs.guide.info"))
  242.  
  243.     (set #guide-icon
  244.       (if (AND (= @user-level 2 ) (= (exists #dest-guide-name) 0))
  245.         (askbool
  246.           (prompt #copy-guide-icon)
  247.           (help #copy-guide-icon-help " ")
  248.         )
  249.         0 ; Default is to not copy the icon
  250.       )
  251.     )
  252.   )
  253. )
  254.  
  255. ; Everything set up. Now do the actual installation
  256.  
  257. (complete 0)
  258.  
  259. (if (BITAND #install-files #item-num-prog)
  260.   (
  261.     (copyfiles
  262.       (prompt (#copy "MultiView" #program-dest))
  263.       (source "Prefs/MultiView")
  264.       (dest #program-dest)
  265.     )
  266.     (copyfiles
  267.       (prompt (#copy "MultiView.info" #program-dest))
  268.       (source "Prefs/MultiView.info")
  269.       (dest #program-dest)
  270.     )
  271.   )
  272. )
  273.  
  274. (complete 50)
  275.  
  276. ;this part dont work because Workbench say"this icon haven't tool".where is the matter??
  277. (if (BITAND #install-files #item-num-guide)
  278.   (
  279.     (set #guide-source
  280.                         (tackon (tackon "Docs/" @language) "MultiViewPrefs.guide")
  281.                 )
  282.           (copyfiles
  283.       (prompt (#copy "MultiViewPrefs.guide" #guide-dest))
  284.       (source #guide-source)
  285.       (dest   #guide-dest)
  286.     )
  287.  
  288.     (if #guide-icon
  289.       (
  290.         (copyfiles
  291.           (prompt (#copy "MultiViewPrefs.guide.info" #guide-dest))
  292.           (source (tackon (tackon "Docs/" @language) "MultiViewPrefs.guide.info"))
  293.           (dest   #guide-dest)
  294.         )
  295.       )
  296.     )
  297.   )
  298. )
  299.  
  300. (complete 100)
  301.  
  302. (exit)
  303.